<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 6.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/custom-logo.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/custom-logo.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/custom-logo.png">
  <link rel="mask-icon" href="/blog/images/custom-logo.png" color="#222">

<link rel="stylesheet" href="/blog/css/main.css">


<link rel="stylesheet" href="/blog/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/blog/lib/pace/pace-theme-minimal.min.css">
  <script src="/blog/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"yinghaidada.github.io","root":"/blog/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":true},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":{"gitalk":{"order":-1}}},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="大致可分为下面几种情况： 1.仓库没有初始化，即空文件夹 1.1 初始化分支">
<meta property="og:type" content="article">
<meta property="og:title" content="如何变更Git仓库中的默认分支名">
<meta property="og:url" content="https://yinghaidada.github.io/blog/2022/05/18/%E5%A6%82%E4%BD%95%E5%8F%98%E6%9B%B4Git%E4%BB%93%E5%BA%93%E4%B8%AD%E7%9A%84%E9%BB%98%E8%AE%A4%E5%88%86%E6%94%AF%E5%90%8D/index.html">
<meta property="og:site_name" content="YINGHAI的博客">
<meta property="og:description" content="大致可分为下面几种情况： 1.仓库没有初始化，即空文件夹 1.1 初始化分支">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2022-05-18T11:12:02.000Z">
<meta property="article:modified_time" content="2022-05-18T12:10:06.340Z">
<meta property="article:author" content="YINGHAI">
<meta property="article:tag" content="Git">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://yinghaidada.github.io/blog/2022/05/18/%E5%A6%82%E4%BD%95%E5%8F%98%E6%9B%B4Git%E4%BB%93%E5%BA%93%E4%B8%AD%E7%9A%84%E9%BB%98%E8%AE%A4%E5%88%86%E6%94%AF%E5%90%8D/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>如何变更Git仓库中的默认分支名 | YINGHAI的博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<style>.darkmode--activated{--body-bg-color:#282828;--content-bg-color:#333;--card-bg-color:#555;--text-color:#ccc;--blockquote-color:#bbb;--link-color:#ccc;--link-hover-color:#eee;--brand-color:#ddd;--brand-hover-color:#ddd;--table-row-odd-bg-color:#282828;--table-row-hover-bg-color:#363636;--menu-item-bg-color:#555;--btn-default-bg:#222;--btn-default-color:#ccc;--btn-default-border-color:#555;--btn-default-hover-bg:#666;--btn-default-hover-color:#ccc;--btn-default-hover-border-color:#666;--highlight-background:#282b2e;--highlight-foreground:#a9b7c6;--highlight-gutter-background:#34393d;--highlight-gutter-foreground:#9ca9b6}.darkmode--activated img{opacity:.75}.darkmode--activated img:hover{opacity:.9}.darkmode--activated code{color:#69dbdc;background:0 0}button.darkmode-toggle{z-index:9999}.darkmode-ignore,img{display:flex!important}.beian img{display:inline-block!important}</style></head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/blog/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">YINGHAI的博客</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">Geek is not geek!</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/blog/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/blog/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/blog/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/blog/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/blog/../" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

  <a href="https://github.com/yinghaidada" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://yinghaidada.github.io/blog/2022/05/18/%E5%A6%82%E4%BD%95%E5%8F%98%E6%9B%B4Git%E4%BB%93%E5%BA%93%E4%B8%AD%E7%9A%84%E9%BB%98%E8%AE%A4%E5%88%86%E6%94%AF%E5%90%8D/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/blog/images/custom-logo.png">
      <meta itemprop="name" content="YINGHAI">
      <meta itemprop="description" content="yinghai blog">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="YINGHAI的博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          如何变更Git仓库中的默认分支名
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2022-05-18 19:12:02 / 修改时间：20:10:06" itemprop="dateCreated datePublished" datetime="2022-05-18T19:12:02+08:00">2022-05-18</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/%E7%BC%96%E7%A8%8B/" itemprop="url" rel="index"><span itemprop="name">编程</span></a>
                </span>
            </span>

          <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>1.9k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>2 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>大致可分为下面几种情况：</p>
<p>1.仓库没有初始化，即空文件夹</p>
<p>1.1 初始化分支</p>
<span id="more"></span>
<p>1.2 使用clone的同步</p>
<p>2.仓库初始化，但并未推送</p>
<p>3.仓库已经推送至远程仓库</p>
<p>解决方式如下：</p>
<p>1.仓库没有初始化，即空文件夹：本地没有仓库的两种情形 1.1 初始化仓库并初始化分支</p>
<figure class="highlight powershell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">以下命令可以初始化仓库并初始化一个分支</span><br><span class="line"><span class="variable">$</span> git init <span class="literal">-b</span> &lt;branch<span class="literal">-name</span>&gt;</span><br><span class="line"><span class="comment"># 例子：main为想变更的默认分支名</span></span><br><span class="line"><span class="variable">$</span> git init <span class="literal">-b</span> main</span><br><span class="line">连接远程仓库</span><br><span class="line"><span class="variable">$</span> git remote add origin &lt;远端仓库链接&gt;</span><br><span class="line">添加暂存区</span><br><span class="line"><span class="variable">$</span> git add .</span><br><span class="line">提交本地仓库</span><br><span class="line"><span class="variable">$</span> git commit <span class="literal">-m</span> <span class="string">&quot;解释说明&quot;</span></span><br><span class="line">推送到远程仓库 <span class="literal">---</span>这里相当于在远端新建了一个main分支</span><br><span class="line"><span class="variable">$</span> git push origin main </span><br><span class="line"></span><br><span class="line">此时远端仓库已经有了main分支</span><br><span class="line"></span><br><span class="line">删除旧的远程分支（如果不想要旧的默认分支，可以删除）</span><br><span class="line"><span class="comment"># 要删除的分支可能是默认分支、受保护分支等，需要先在仓库管理平台仓库设置中选择新分支main为默认分支，然后再执行命令。</span></span><br><span class="line"><span class="variable">$</span> git push origin <span class="literal">--delete</span> &lt;branch<span class="literal">-name</span>&gt;   </span><br><span class="line"></span><br><span class="line"><span class="comment"># 例子</span></span><br><span class="line"><span class="variable">$</span> git push origin <span class="literal">--delete</span> master</span><br></pre></td></tr></table></figure>
<p>****1.2 其他使用clone的同步****</p>
<figure class="highlight powershell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#对于其他 clone 的同步</span></span><br><span class="line"></span><br><span class="line">对于已经 clone 的仓库通过如下步骤进行同步：</span><br><span class="line"></span><br><span class="line"><span class="variable">$</span> git fetch   `拉取远端分支信息`</span><br><span class="line"><span class="variable">$</span> git remote <span class="built_in">set-head</span> origin <span class="literal">-a</span>  `更新本地 upstream</span><br><span class="line"><span class="comment">#例子：</span></span><br><span class="line"><span class="variable">$</span> git branch <span class="literal">-m</span> master main</span><br><span class="line"><span class="comment"># 上述命令将 `master` 分支重命名为了 `main`。但这个变更只是本地的，需要同步到远端。</span></span><br><span class="line"></span><br><span class="line">第二步：推送本地分支至远程仓库</span><br><span class="line"><span class="variable">$</span> git push <span class="literal">-u</span> origin &lt;branch<span class="literal">-name</span>&gt;</span><br><span class="line"><span class="comment"># 例子</span></span><br><span class="line"><span class="variable">$</span> git push <span class="literal">-u</span> origin main</span><br><span class="line"></span><br><span class="line"><span class="comment"># 上述命令将新建的 `main` 分支同步到远端并设置 upstream 到了该分支。</span></span><br><span class="line"></span><br><span class="line">第三步：删除远程分支（如果不想要旧的默认分支，可以删除）</span><br><span class="line"></span><br><span class="line"><span class="comment"># 要删除的分支可能是默认分支、受保护分支等，需要先在仓库管理平台仓库设置中选择新分支为默认分支，然后再执行命令。</span></span><br><span class="line"><span class="variable">$</span> git push origin <span class="literal">--delete</span> &lt;branch<span class="literal">-name</span>&gt;   </span><br><span class="line"></span><br><span class="line"><span class="comment"># 例子</span></span><br><span class="line"><span class="variable">$</span> git push origin <span class="literal">--delete</span> master</span><br><span class="line"></span><br><span class="line"><span class="built_in">PS</span>：关于git remote <span class="built_in">set-head</span>命令的解释说明</span><br><span class="line">设置或删除跟踪仓库的HEAD,指向指定分支,命令行中的圆括号表示必选其中之一执行</span><br><span class="line"><span class="variable">$</span> git remote <span class="built_in">set-head</span> &lt;origin&gt; (<span class="literal">-a</span> | <span class="literal">--auto</span> | <span class="literal">-d</span> | <span class="literal">--delete</span> | &lt;branch&gt;) </span><br><span class="line">    [-<span class="type">a</span>|--<span class="type">auto</span>]     <span class="comment"># set refs/remotes/&lt;name&gt;/HEAD according to remote</span></span><br><span class="line">    [-<span class="type">d</span>|--<span class="type">delete</span>]   <span class="comment"># delete refs/remotes/&lt;name&gt;/HEAD</span></span><br></pre></td></tr></table></figure>
<p>• ****2.仓库初始化，但并未推送 ：初始化后未推送，可以直接修改本地的分支名****</p>
<figure class="highlight powershell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable">$</span> git branch <span class="literal">-m</span> &lt;oldbranch&gt; &lt;newbranch&gt;</span><br><span class="line"><span class="comment"># 举例说明</span></span><br><span class="line"><span class="variable">$</span> git branch <span class="literal">-m</span> master main</span><br><span class="line"></span><br><span class="line">连接远程仓库</span><br><span class="line"><span class="variable">$</span> git remote add origin &lt;远端仓库链接&gt;</span><br><span class="line">添加暂存区</span><br><span class="line"><span class="variable">$</span> git add .</span><br><span class="line">提交本地仓库</span><br><span class="line"><span class="variable">$</span> git commit <span class="literal">-m</span> <span class="string">&quot;解释说明&quot;</span></span><br><span class="line"></span><br><span class="line">推送到远程仓库</span><br><span class="line"><span class="variable">$</span> git push origin main </span><br><span class="line">注意：这里在推送的时候，可能会报错，因为可能需要你先pull远程到本地，使远程与本地驳斥一致后，才可以推送</span><br><span class="line">不过，你也可以忽略报错的提示，使用<span class="operator">-f</span>强制推送，即<span class="variable">$</span> git push origin main <span class="operator">-f</span></span><br><span class="line"></span><br><span class="line">删除旧的远程分支（如果不想要旧的默认分支，可以删除）</span><br><span class="line"></span><br><span class="line"><span class="comment"># 要删除的分支可能是默认分支、受保护分支等，需要先在仓库管理平台仓库设置中选择新分支为默认分支，然后再执行命令。</span></span><br><span class="line"><span class="variable">$</span> git push origin <span class="literal">--delete</span> &lt;branch<span class="literal">-name</span>&gt;   </span><br><span class="line"></span><br><span class="line"><span class="comment"># 例子</span></span><br><span class="line"><span class="variable">$</span> git push origin <span class="literal">--delete</span> master</span><br></pre></td></tr></table></figure>
<p>• ****3.仓库已经推送至远程仓库：已经提交至远程仓库，去修改分支名****</p>

    </div>

    
    
    

      <footer class="post-footer">
          
          <div class="post-tags">
              <a href="/blog/tags/Git/" rel="tag"><i class="fa fa-tag"></i> Git</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/blog/2022/05/18/%E5%85%B3%E4%BA%8E%E5%95%86%E5%93%81%E7%BB%8F%E6%B5%8E%E7%A4%BE%E4%BC%9A%E4%B8%8E%E6%83%85%E6%84%9F%E5%BD%92%E5%B1%9E/" rel="prev" title="关于商品经济社会与情感归属">
      <i class="fa fa-chevron-left"></i> 关于商品经济社会与情感归属
    </a></div>
      <div class="post-nav-item">
    <a href="/blog/2022/06/06/%E6%81%B6%E6%84%8F-%E8%AF%BB%E5%90%8E%E9%9A%8F%E7%AC%94/" rel="next" title="恶意-读后随笔">
      恶意-读后随笔 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="gitalk-container"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="YINGHAI"
      src="/blog/images/custom-logo.png">
  <p class="site-author-name" itemprop="name">YINGHAI</p>
  <div class="site-description" itemprop="description">yinghai blog</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/blog/archives/">
        
          <span class="site-state-item-count">32</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/blog/categories/">
          
        <span class="site-state-item-count">4</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/blog/tags/">
          
        <span class="site-state-item-count">20</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/yinghaidada" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;yinghaidada" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:pyj2897022134@gmail.com" title="E-Mail → mailto:pyj2897022134@gmail.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">YINGHAI</span>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/blog/lib/anime.min.js"></script>
  <script src="/blog/lib/velocity/velocity.min.js"></script>
  <script src="/blog/lib/velocity/velocity.ui.min.js"></script>

<script src="/blog/js/utils.js"></script>

<script src="/blog/js/motion.js"></script>


<script src="/blog/js/schemes/muse.js"></script>


<script src="/blog/js/next-boot.js"></script>




  




  
<script src="/blog/js/local-search.js"></script>
















  

  
<script src="https://unpkg.com/darkmode-js@1.5.7/lib/darkmode-js.min.js"></script>

<script>
var options = {
  bottom: '64px',
  right: '64px',
  left: 'unset',
  time: '0.5s',
  mixColor: 'transparent',
  backgroundColor: 'transparent',
  buttonColorDark: '#100f2c',
  buttonColorLight: '#fff',
  saveInCookies: false,
  label: '🌙',
  autoMatchOsTheme: false
}
const darkmode = new Darkmode(options);
window.darkmode = darkmode;
darkmode.showWidget();
if (window.darkmode && !window.darkmode.isActivated()) {
  window.darkmode.toggle();
  var toggleButtons = document.getElementsByClassName("darkmode-toggle");
  for (i = 0; i < toggleButtons.length; i++) {
    toggleButtons[i].classList.add("darkmode-toggle--white");
  }
}
</script>

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.css">

<script>
NexT.utils.loadComments(document.querySelector('#gitalk-container'), () => {
  NexT.utils.getScript('//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js', () => {
    var gitalk = new Gitalk({
      clientID    : 'eb390542af2d8e7c40f6',
      clientSecret: 'da7c86f6dc30627c9dc57034aebba2c3ec933a4f',
      repo        : 'personalWeb-comment',
      owner       : 'yinghaidada',
      admin       : ['yinghaidada'],
      id          : '2f0b03cedd29bf4366c6efe5e0f17381',
        language: 'zh-CN',
      distractionFreeMode: true
    });
    gitalk.render('gitalk-container');
  }, window.Gitalk);
});
</script>

</body>
</html>
